<?php

namespace Mssae\SeoBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert ;

/**
 * Mssae\SeoBundle\Entity\Annuaire
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="Mssae\SeoBundle\Entity\AnnuaireRepository")
 */
class Annuaire
{
    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string $nom
     *
     * @ORM\Column(name="nom", type="string", length=255)
     * @Assert\NotBlank()
     * @Assert\MinLength(limit = 3)
     */
    private $nom;

    /**
     * @var string $url
     *
     * @ORM\Column(name="url", type="string", length=255)
     * @Assert\Url()
     */
    private $url;

    /**
     * @var datetime $create_at
     *
     * @ORM\Column(name="create_at", type="datetime")
     * @Assert\DateTime()
     */
    private $create_at;

    /**
     * @var smallint $statut
     *
     * @ORM\Column(name="statut", type="smallint")
     * @Assert\Max(1)
     * @Assert\Min(0)
     */
    private $statut;
    
    /**
     * @ORM\ManyToOne(targetEntity="TypeAnnuaire")
     */
    protected $typeAnnuaire ;
    
    public function __construct()
    {
        $this->create_at = new \DateTime() ;
    }

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set nom
     *
     * @param string $nom
     */
    public function setNom($nom)
    {
        $this->nom = $nom;
    }

    /**
     * Get nom
     *
     * @return string 
     */
    public function getNom()
    {
        return $this->nom;
    }

    /**
     * Set url
     *
     * @param string $url
     */
    public function setUrl($url)
    {
        $this->url = $url;
    }

    /**
     * Get url
     *
     * @return string 
     */
    public function getUrl()
    {
        return $this->url;
    }

    /**
     * Set create_at
     *
     * @param datetime $createAt
     */
    public function setCreateAt($createAt)
    {
        $this->create_at = $createAt;
    }

    /**
     * Get create_at
     *
     * @return datetime 
     */
    public function getCreateAt()
    {
        return $this->create_at;
    }

    /**
     * Set statut
     *
     * @param smallint $statut
     */
    public function setStatut($statut)
    {
        $this->statut = $statut;
    }

    /**
     * Get statut
     *
     * @return smallint 
     */
    public function getStatut()
    {
        return $this->statut;
    }

    /**
     * Set typeAnnuaire
     *
     * @param Mssae\SeoBundle\Entity\TypeAnnuaire $typeAnnuaire
     */
    public function setTypeAnnuaire(\Mssae\SeoBundle\Entity\TypeAnnuaire $typeAnnuaire)
    {
        $this->typeAnnuaire = $typeAnnuaire;
    }

    /**
     * Get typeAnnuaire
     *
     * @return Mssae\SeoBundle\Entity\TypeAnnuaire 
     */
    public function getTypeAnnuaire()
    {
        return $this->typeAnnuaire;
    }
    
    public function __toString()
    {
       // return $this->nom ;
        return $this->url ;
    }
}